package com.zhangqiang.git.cloud.remote.model;

import com.zhangqiang.git.cloud.domain.consumer.SysUser;
import com.zhangqiang.git.cloud.remote.factory.RemoteUserFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 用户服务
 * 
 * @author
 */
@FeignClient(contextId = "RemoteUserService", value = "hello-spring-cloud-consumer", fallbackFactory = RemoteUserFallbackFactory.class)
public interface RemoteUserService
{
    /**
     * 通过用户名查询用户信息
     *
     * @param username 用户名
     * @return 结果
     */
    @PostMapping(value = "/consumer/findUserByName")
    public SysUser findUserByName(@RequestParam("username") String username);


    /**
     * 通过用户名查询用户信息
     *
     * @param username 用户名
     * @return 结果
     */
    @PostMapping(value = "/consumer/findUserByName")
    public List<String> findRolesByUser(@RequestParam("username")String username);

}
